﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace AppFabricAdministrator
{
    public partial class RefreshCache : UserControl
    {
        private static string StartCacheCmd = @"Start-CacheCluster";
        private static string StopCacheCmd = @"Stop-CacheCluster";
        private static string ReStartCacheCmd = @"Restart-CacheCluster";
        
        public RefreshCache()
        {
            InitializeComponent();
        }

        private void btnStartCluster_Click(object sender, EventArgs e)
        {
            AppfabricAdministrator.Current.RunScript(StartCacheCmd, "Cache Services started successfully");
        }

        private void btnStopCluster_Click(object sender, EventArgs e)
        {
            AppfabricAdministrator.Current.RunScript(StopCacheCmd, "Cache Services stopped successfully");
        }

        private void btnRestartCluster_Click(object sender, EventArgs e)
        {
            AppfabricAdministrator.Current.RunScript(ReStartCacheCmd, "Cache Services restarted successfully");
        }




    }
}
